<?php

use Illuminate\Database\Seeder;

class UsersTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {	
    	
    	$time = date('Y-m-d H:i:s');
    	for($i = 0; $i < 100; $i++)
    	{
    		$data=
	    		[
	            'username' => str_random(10),
	            'email' => str_random(10).'@gmail.com',
	            'password' => Crypt::encryptString('123456'),
	            'phone' => '12354554678',
	            'token' => str_random(50),
	            'airline' => 0,
	            'status' => 0,
	            'created_at' => $time,
	            'updated_at' => $time,
	       		];

	       	$userId = DB::table('users')->insertGetId($data);
    		$picname = "/uploads/avatar/default.jpg";

    		DB::table('users_info') -> insert([
    			'uid' => $userId,
    			'picname' => $picname,
    			'created_at' => $time,
	            'updated_at' => $time,

    			]);

    	}
       
    }
}
